package cn.centec.web;

import cn.centec.bid.util.Centec6BidReceiveApiUtil;
import cn.centec.core.constant.RequestModule;
import cn.centec.core.entity.Result;
import cn.centec.core.entity.StandardRequestParam;
import cn.centec.mall.util.Centec6MallReceiveApiUtil;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;

/**
 * 采购中心API
 *
 * @author 延晓磊
 * @since 2022年10月26日
 */
public class Centec6Controller {

    @Resource
    private Centec6BidReceiveApiUtil centec6BidReceiveApiUtil;
    @Resource
    private Centec6MallReceiveApiUtil centec6MallReceiveApiUtil;

    /**
     * 接收请求
     *
     * @param param
     * @return
     *
     * @author 延晓磊
     * @since 2022年11月04日
     */
    @PostMapping("/centec6")
    public Result receive(StandardRequestParam param){
        if (RequestModule.BID.equals(param.getModule())) {
            // 招投标业务
            return centec6BidReceiveApiUtil.receive(param);
        }else{
            // 商城业务
            return centec6MallReceiveApiUtil.receive(param);
        }
    }
}
